/*
 * Sphere.cpp
 *
 *  Created on: 19/05/2010
 *      Author: jorge
 */

#include "Sphere.h"
#include <GL/glut.h>

namespace graphics {

Sphere::Sphere(float radio) : radio(radio) {
	center = Vector3D(0, 0, 0);
	color = Vector3D(0, 0, 0);
}

void Sphere::setColor(const Vector3D& c) {
	color = c;
}

void Sphere::setCenter(const Vector3D& c) {
	center = c;
}

const Vector3D Sphere::getColor() const {
	return color;
}

const Vector3D Sphere::getCenter() const {
	return center;
}

void Sphere::draw() {

	glColor3fv(color.get());
	glPushMatrix();
		glTranslatef(this->center.getX(), this->center.getY(), this->center.getZ());
		glutSolidSphere(radio, 20, 20);
	glPopMatrix();
}

float Sphere::getRadio() const {
	return radio;
}

Sphere::~Sphere() {

}

}
